import React from 'react';
import {
  Form,
  Modal,
} from 'antd';

import DescriptionList from '@/components/DescriptionList';

const { Description } = DescriptionList;

// 查看详情
const DescView = Form.create()(props => {
  const { lookDescView, handleLookDesc, selectedRows } = props;
  const status = (status) => {
    if (status === 1) {
      return '未放款';
    }else if(status === 2) {
      return '放款中';
    }else if(status === 3) {
      return '成功';
    }else if(status === 4) {
      return '失败';
    }else if(status === 6) {
      return '提现成功';
    }
  };
  return (
    <Modal
      width={640}

      destroyOnClose
      title="查看放款信息"
      visible={lookDescView}
      onOk={() => handleLookDesc(false,[])}
      onCancel={() => handleLookDesc(false, [])}>
      <DescriptionList size="large" style={{ marginBottom: 32 }} col="2">
        <Description term="放款编号">{selectedRows.loanNo}</Description>
        <Description term="项目编号">{selectedRows.projectNo}</Description>
        <Description term="项目名称">{selectedRows.projectName}</Description>
        <Description term="企业编号">{selectedRows.enterpriseNo}</Description>
        <Description term="企业名称">{selectedRows.enterpriseName}</Description>
        <Description term="融资金额">{selectedRows.amount}</Description>
        <Description term="募集金额">{selectedRows.raiseAmount}</Description>
        <Description term="放款金额">{selectedRows.loanAmount}</Description>
        <Description term="放款时间">{selectedRows.loanTime}</Description>
        <Description term="起息日">{selectedRows.interestTime}</Description>
        <Description term="状态">{status(selectedRows.status)}</Description>
        <Description term="创建人">{selectedRows.createName}</Description>
        <Description term="创建时间">{selectedRows.createTime}</Description>
      </DescriptionList>
    </Modal>
  );
});

export default DescView;
